package com.company.bookstore.entities.book_module;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author 姬深威
 * @since 2020-09-12
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_book")
public class Book extends Model<Book> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String bookName;
    private Integer repositoryNum;
    private String bookDes;
    private String author;
    private String publisher;
    private Double price;
    private Double oldPrice;
    private Integer hotClick;
    private Integer sales;
    private Integer deleted;

    @TableField(exist = false)
    private List<BookImg> bookImgs;
    @TableField(exist = false)
    private List<Category> categories;
    @TableField(exist = false)
    @Transient
    private long endTime;

}
